package cn.aliang.cloud.hystrixpayment.controller;

import cn.aliang.cloud.hystrixpayment.service.PaymentHystrixSerivce;
import cn.aliang.cloud.service.entity.ResultMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: chendongliang
 * @Date: 2020/7/21 15:34
 */

@RestController
@RequestMapping("/payment/hystrix")
public class PaymentController {


    @Autowired
    PaymentHystrixSerivce paymentHystrixSerivce;


    @GetMapping("/pay/{id}")
    public ResultMessage payTimeout(@PathVariable("id") String id){

        return paymentHystrixSerivce.payTimeout(id);
    }


    @GetMapping("/payCircuitBreaker/{id}")
    public ResultMessage payCircuitBreaker(@PathVariable("id") String id){

        return paymentHystrixSerivce.payCircuitBreaker(id);

    }

}
